package org.example.domain;

import lombok.Data;
import lombok.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.convert.DataSizeUnit;
import org.springframework.boot.convert.DurationUnit;
import org.springframework.stereotype.Component;
import org.springframework.util.unit.DataSize;
import org.springframework.util.unit.DataUnit;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Max;
import java.time.temporal.ChronoUnit;

@Data
//@Component
@ConfigurationProperties(prefix="servers")
@Validated
public class ConfigruationServer {
    private String Ipdress;
    private String System;
    @Max(value = 99999,message = "超过最大值")
    private Integer Timeout;
   @DurationUnit(ChronoUnit.HOURS)
    private  long time;
   @DataSizeUnit(DataUnit.GIGABYTES)
   private DataSize dataSize;
}
